package com.fujitsu.cn.fnst.velocity.tool;

import java.util.List;

import org.apache.velocity.tools.config.DefaultKey;
import org.apache.velocity.tools.generic.SafeConfig;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.Scope;

import com.fujitsu.cn.fnst.entiy.User;
import com.fujitsu.cn.fnst.service.UserService;

@Configurable("userTool")
@DefaultKey("userTool")
@Scope
@DependsOn
public class UserTool extends SafeConfig {
    private UserService userService;

    public UserService getUserService() {
        return userService;
    }

    public List<User> getAllUsers() {
        return userService.getAllUsers();

    }

    public User getUser(int id) {
        return userService.find(id);

    }
    public void setUserService(UserService userService) {
        this.userService = userService;
    }

}
